﻿<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
	<meta charset="utf-8">
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<title>layui在线调试</title>
	<script src="http://106.12.215.182:8080/hello-0.0.1-SNAPSHOT//layui/layui.js"></script>
	<script type="text/javascript" src="http://106.12.215.182:8080/hello-0.0.1-SNAPSHOT//jquery/jquery-1.8.3.min.js" charset="utf-8"></script>
	<link rel="stylesheet" href="http://106.12.215.182:8080/hello-0.0.1-SNAPSHOT//layui/css/layui.css" media="all">
	<style>
	</style>
</head>
<body>
<div class="content"></div>


<script>
    var data;
	function pageQuery(curr,limitCount) {


        $.ajax({
            url: "http://106.12.215.182:8080/hello-0.0.1-SNAPSHOT//show/all",
            contentType: "application/json",
            type: "get",
            async: false,
            success: function (data0) {
                data = JSON.stringify(data0);
                console.log("请求数据成功");
                console.log(curr);
            },
            error: function () {
                console.log("未知错误");
            }

        });
    }
	var limitCount=10;
    layui.use('laypage', function(){
        var laypage = layui.laypage;
        laypage.render({
            elem: 'test1'
            ,limit:limitCount
            ,count:70
            ,curr:1
            ,jump:function(obj,first){
                if(!first) {
                    //第一次不执行,一定要记住,这个必须有,要不然就是死循环
                    //回调该展示数据的方法,数据展示
                    pageQuery(obj.curr,limitCount);
                }
            }

        });
    });


</script>
</body>
